﻿@model IEnumerable<CoreDemo.Model.Cinema>
@{
    ViewData["Title"] = ViewBag.Title;
}
@using CoreDome.Settings
@using Microsoft.Extensions.Options
@inject IOptions<ConfigOptions> option


<div class="container">
    <div class="row">
        <table class="table table-bordered table-hover table-primary">
            <thead class="thead-dark">
                <tr>
                    <th>Id</th>
                    <th>Name</th>
                    <th>Location</th>
                    <th>Capacity</th>
                    <th>操作  @option.Value.DefaultConnectionString</th>
                </tr>
            </thead>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@item.Id</td>
                    <td>@item.Name</td>
                    <td>@item.Location</td>
                    <td>@item.Capacity</td>
                    <td>
                        <a asp-controller="Movie" asp-action="Index" asp-route-cinemaId="@item.Id">查看</a>
                        <a asp-controller="Home" asp-action="Edit" asp-route-id="@item.Id">编辑</a>
                    </td>
                </tr>
            }
        </table>
        <a class="btn btn-primary" asp-action="Add">添加</a>
        @await Component.InvokeAsync("MovieCount")
    </div>
</div>

